﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using TheVoiceOfSnake.Models;
using TheVoiceOfSnake.Enums;

namespace TheVoiceOfSnake.Models
{
    public class GameField : Field
    {
        protected FieldState fieldState;

        public GameField() : base()
        {
            FieldState = Enums.FieldState.Empty;
        }

        public GameField(Point coordinates)
            : base(coordinates)
        {
            FieldState = Enums.FieldState.Empty;
        }

        public GameField(int x, int y)
            : base(x, y)
        {
            FieldState = Enums.FieldState.Empty;
        }

        public FieldState FieldState
        {
            get { return this.fieldState; }
            set { fieldState = value; }
        }

        #region operators
        public static bool operator ==(GameField left, Point right) 
        {
            return left.Coordinates.X == right.X && left.Coordinates.Y == right.Y;
        }

        public static bool operator !=(GameField left, Point right)
        {
            return left.Coordinates.X != right.X && left.Coordinates.Y != right.Y;
        }

        public static bool operator <(GameField left, Point right)
        {
            return left.Coordinates.X < right.X && left.Coordinates.Y < right.Y;
        }

        public static bool operator >(GameField left, Point right)
        {
            return left.Coordinates.X > right.X && left.Coordinates.Y > right.Y;
        }

        public static bool operator <=(GameField left, Point right)
        {
            return left.Coordinates.X <= right.X && left.Coordinates.Y <= right.Y;
        }

        public static bool operator >=(GameField left, Point right)
        {
            return left.Coordinates.X >= right.X && left.Coordinates.Y >= right.Y;
        }
        #endregion
    }
}
